﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="PR_ScoreMain.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PR_ScoreMain" %>

<%@ Register src="../Controls/MasterYear.ascx" tagname="MasterYear" tagprefix="uc1" %>
<%@ Register src="../Controls/EmployeeTypeCombo.ascx" tagname="EmployeeTypeCombo" tagprefix="uc2" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc3" %>

<asp:Content 
    ID="Content1" 
    runat="server" 
    contentplaceholderid="ContentPlaceHolder1">     
  
            <script type="text/javascript">
               
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
                function MessageAlert(strMessageAlert) {
                    window.alert(strMessageAlert);
                }
            </script>
           

              <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cbYear">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cbYear" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cbEmployeeType">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cbEmployeeType" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="radPeriod">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="radPeriod" LoadingPanelID="RadAjaxLoadingPanel1"/> 
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        
       <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" /> 
            
            <asp:panel ID="Panel5" runat="server" > 
            
            <table>           
               
            <tr>
            <td width="280" valign = "top">
               <!-- <uc3:user ID="user1" runat="server" /> -->
            </td>
            <td width="20" >
            </td>
            <td>
            <div class="moduleDivSlim700">
                    <div class="moduleDivBottom700">
                         <asp:Panel ID="PanelFilter" runat="server" Width="700px" ScrollBars="Auto">
                            <table align = "center" width = "650px">
                                <tr>
                                    <td align="left" width = "220px">
                                        ประเภทบุคลากร : 
                                        <telerik:RadComboBox ID="cbEmployeeType" 
                                            runat="server" AutoPostBack="True" 
                                            CausesValidation="false" 
                                            DataTextField="Name" 
                                            DataValueField="Sequence" 
                                            EmptyMessage="... ประเภทบุคลากร..." 
                                            Filter="Contains" 
                                            OnClientTextChange="onTextChange" 
                                            onselectedindexchanged="cbEmployeeType_SelectedIndexChanged" 
                                            Width="150px">
                                        </telerik:RadComboBox>
                                    </td>
                                    <td align="left" width = "180px">
                                        ปีงบประมาณ : 
                                        <telerik:RadComboBox ID="cbYear" runat="server" 
                                            AllowCustomText="true" 
                                            AutoPostBack="True" 
                                            CausesValidation="false" 
                                            DataTextField="Name" 
                                            DataValueField="Name" 
                                            EmptyMessage="...เลือกปี ..." 
                                            Filter="Contains" 
                                            OnClientTextChange="onTextChange" 
                                            onselectedindexchanged="cbYear_SelectedIndexChanged" Width="100px">
                                        </telerik:RadComboBox>
                                    </td>                                        
                                   <td align="right" >
                                        รอบการประเมิน : </td>
                                   <td>
                                   <asp:RadioButtonList ID="radPeriod" runat="server" 
                                        RepeatDirection="Horizontal" 
                                        AutoPostBack = "true"
                                        RepeatLayout="Flow" 
                                        onselectedindexchanged="radPeriod_SelectedIndexChanged">
                                        <asp:ListItem Selected="True" Value="1">ครั้งที่ 1</asp:ListItem>
                                        <asp:ListItem Value="2">ครั้งที่ 2</asp:ListItem>
                                   </asp:RadioButtonList>
                                   </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </div>
                </div>
            </td>
          </tr>         
                   
          </table>         
            
        <div class="moduleDivSlim1000x450">
        <div class="moduleDivBottom1000">
        <table align="center" width="900px">
            <tr>
                    <td align="left" class="tableHeader">
                        เกณฑ์การประเมินระดับองค์กร</td>
                </tr>
            </table>
          <table align="center" width="900px">
          <tr>
            <td>
               <asp:Panel ID="PanelGrid" 
                    runat="server" 
                    Width="900px" 
                    Height="400px" ScrollBars="Auto">
                <telerik:RadGrid ID="RadGrid1" runat="server" 
                        AllowAutomaticDeletes="True" 
                        AllowFilteringByColumn="true" AllowMultiRowEdit="True" 
                        AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True" 
                        AutoGenerateColumns="False" EnableAJAX="True" EnableAJAXLoadingTemplate="True" 
                        GridLines="None" 
                        OnItemCommand="RadGrid1_ItemCommand" Skin="Outlook" 
                        Width="880px">
                        <MasterTableView 
                            AllowMultiColumnSorting="True"                             
                            CellSpacing="-1" 
                            ClientDataKeyNames="std_dtls_seq" 
                            CommandItemDisplay="Top" 
                            DataKeyNames="std_dtls_seq" 
                            InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                            NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                            <CommandItemTemplate>
                                <table width="100%">
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                                CommandName="InitInsert" 
                                                Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                                            <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                                style="border: 0px; vertical-align: middle;" />เพิ่มระดับผลการประเมินหลัก</asp:LinkButton>
                                            &nbsp;&nbsp;
                                        </td>
                                        <td align="right">
                                        </td>
                                    </tr>
                                </table>
                            </CommandItemTemplate>
                            <RowIndicatorColumn>
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn Visible="True">
                            </ExpandCollapseColumn>                             
                                  <Columns> 
                                  <telerik:GridEditCommandColumn 
                                    ButtonType="ImageButton" 
                                    EditText="คลิกเพื่อแก้ไขข้อมูล">
                                    <ItemStyle Width="15px" />
                                </telerik:GridEditCommandColumn>
                                <telerik:GridButtonColumn 
                                    ButtonType="ImageButton" 
                                    CommandName="Delete" 
                                    ConfirmDialogType="RadWindow" 
                                    ConfirmText="ลบข้อมูลที่เลือก?" 
                                    Text="คลิกเพื่อลบข้อมูล" UniqueName="column1">
                                    <HeaderStyle HorizontalAlign="Center" Width="10px" />
                                    <ItemStyle HorizontalAlign="Center" Width="10px" />
                                </telerik:GridButtonColumn>                       
                                  <telerik:GridTemplateColumn
                                        DataField = "score_level_no"
                                        HeaderText = "ระดับ"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter="true" 
                                        CurrentFilterFunction="Contains" 
                                        ShowFilterIcon="False">
                                    <ItemTemplate>
                                        <%# Eval("score_level_no")%>                        
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                    </telerik:GridTemplateColumn>                                
                                
                                    <telerik:GridTemplateColumn
                                        DataField = "score_level_name"
                                        HeaderText = "ระดับผลการประเมิน"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter="true" 
                                        CurrentFilterFunction="Contains" 
                                        ShowFilterIcon="False"                                        
                                        UniqueName = "score_level_name">                                             
                                    <ItemTemplate>
                                    <%# Eval("score_level_name")%>                
                                             </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                    </telerik:GridTemplateColumn>                                  
                                 
                                    <telerik:GridTemplateColumn
                                        DataField = "score_min"                       
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="ช่วงคะแนน" 
                                        UniqueName="score_min">
                                         <ItemTemplate>
                                   <%# Eval("score_min")%>      &nbsp; &nbsp; - &nbsp; &nbsp;      <%# Eval("score_max")%>         
                                    </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>                                
                                       
                                </Columns>
                                <EditFormSettings                                     
                                    EditFormType="WebUserControl" 
                                    UserControlName="../UserControls/PR_ScoreMain.ascx">
                                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                                </EditFormSettings>
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            </MasterTableView><ClientSettings AllowColumnHide="True" 
                                AllowColumnsReorder="True" 
                                EnableRowHoverStyle="True" 
                                ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" 
                                EnableDragToSelectRows="true" />
                                </ClientSettings>
                        </telerik:RadGrid>
           </asp:Panel> 
          </td>
          
          </tr>
        
          </table>
          </div>
          </div>
          
            </asp:Panel>

                        
</asp:Content>